/*********************************************************************
* File: IFinances.h
*
* Supports money management.
*********************************************************************/
#pragma once

#include "../../game/globals.h"
using namespace game;

namespace agents{namespace interfaces{
	/**
	* \class IFinances
	* \brief Supports money management.
	*
	* Supports money management and armory upgrade. 
	*
	* \author Instituto Superior Tecnico de Lisboa, Portugal
	* \author Technical University of Lisbon, Portugal
	* 
	* \author Agentes Autonomos e Sistemas Multiagente
	* \author Autonomous Agents and Multiagent Systems
	* 
	* \version	1.0
	* \date		2006/2007
	**/
	class IFinances
	{
	public:
		/**
		* \brief The agent's amount of money.
		**/
		virtual int money() = 0;
		/**
		* \brief Whether the agent is in a Buy Zone.
		*
		* Maps have specific 'Buy Zones' where it is possible to upgrade
		* armory. Agents can buy outside these zones. 
		**/
		virtual bool inBuyZone() = 0;
		/**
		* \brief Whether 'Buy Time' has elapsed.
		*
		* Agents can only buy armory for a certain period of time - 
		* the 'Buy Time'. When exceeded, agents can buy anymore.
		**/
		virtual bool withinBuyTime() = 0;
		/**
		* \brief Purchase a weapon by name.
		*
		* Only works if the agent has enough money, is within a 
		* Buy Zone (see #inBuyZone) and within Buy Time (see #withinBuyTime).
		*
		* \param[in] name The weapon name.
		**/
		virtual bool buy(char* name) = 0;
		/**
		* \brief Purchase a weapon by id.
		*
		* Only works if the agent has enough money, is within a 
		* Buy Zone (see #inBuyZone) and within Buy Time (see #withinBuyTime).
		*
		* \param[in] name The weapon name.
		**/
		virtual bool buy(WeaponIds::Enumeration item) = 0;
	};
}}
